import { Component, Input, OnInit } from '@angular/core';

import { ViewCell } from 'ng2-smart-table';

@Component({
  template: `
    {{renderValue}}
  `,
})
export class FileSizeRenderComponent implements ViewCell, OnInit {

  renderValue: string;

  @Input() value: number;
  @Input() rowData: any;

  ngOnInit() {
    this.renderValue = (this.value / 1024 / 1024).toFixed(2) + 'MB';
  }

}
